<template>
  <section class="page">
    <div class="title">{{ this.sessionStorageData.orgNm + this.sessionStorageData.billstdNm || "采 购 变 更 单" }}</div>
    <div class="horizontal-direction" style="margin-bottom: 10px">
      <div class="horizontal-box" style="display: flex">
        <span style="min-width: 60px">原厂商:</span><span style="max-width: 125px; width: 100%">{{ this.propsForm.ovendNm }}</span>
      </div>
      <div class="horizontal-box" style="display: flex">
        <span style="min-width: 60px"> 新厂商：</span><span style="max-width: 125px; width: 100%">{{ this.propsForm.nvendNm }}</span>
      </div>
      <div class="horizontal-box" style="display: flex">
        <span style="min-width: 70px"> 采购日期：</span><span>{{ this.propsForm.oordDate.substring(0, 10) || "" }}</span>
      </div>
      <div class="horizontal-box" style="display: flex">
        <span style="min-width: 70px"> 变更日期：</span><span>{{ this.propsForm.nordDate.substring(0, 10) || "" }}</span>
      </div>
      <div class="horizontal-box" style="display: flex">
        <span style="min-width: 70px"> 采购单号：</span><span>{{ this.propsForm.orderNo }}</span>
      </div>
    </div>

    <div style="margin-bottom: 15px">
      <table cellspacing="0" cellpadding="0" border="1" class="out-table" style="width: 100%">
        <thead class="has-gutter">
          <tr class="text-center">
            <th>序号</th>
            <th>材料编码</th>
            <th colspan="11">材料名称</th>
            <th>单位</th>
            <th>数量</th>
            <th>单价</th>
            <th>金额</th>
          </tr>
        </thead>
        <tbody>
          <template v-for="(item, index) in this.propsForm.detailList || []">
            <tr :key="index + 'Only'">
              <td rowspan="2">{{ item.orderSeq }}</td>
              <td>{{ item.oitem }}</td>
              <td colspan="2" style="color: blue">旧</td>
              <td colspan="9">{{ item.oitemNm }}</td>
              <td>{{ item.ounit }}</td>
              <td>{{ item.oordQty }}</td>
              <td>{{ item.opriceCur }}</td>
              <td>{{ item.omoney }}</td>
            </tr>
            <tr :key="index + 'Only2'">
              <td>{{ item.nitem }}</td>
              <td colspan="2" style="color: red">新</td>
              <td colspan="9">{{ item.nitemNm }}</td>
              <td>{{ item.nunit }}</td>
              <td>{{ item.nordQty }}</td>
              <td>{{ item.npriceCur }}</td>
              <td>{{ $util.formatPrice(item.nmoney) }}</td>
            </tr>
          </template>
        </tbody>
      </table>
    </div>
    <div class="base-stamp">
      <table cellspacing="0" cellpadding="0" border="0" class="el-table__header table-flow">
        <thead class="has-gutter">
          <tr class="text-left">
            <th><div class="examine-cell">签核角色</div></th>
            <th><div class="examine-cell">审核人员</div></th>
            <th><div class="examine-cell">审核状况</div></th>
            <th><div class="examine-cell">审核意见</div></th>
            <th><div class="examine-cell">审核时间</div></th>
          </tr>
        </thead>
        <tbody>
          <template>
            <tr class="text-left" v-for="(item, index) in propsForm.qhChkmgrdList || []" :key="index">
              <td>
                <div>{{ item.flowDesc }}</div>
              </td>
              <td>
                <div>{{ item.toUserCname }}</div>
              </td>
              <td>
                <div>{{ item.chkStatusName }}</div>
              </td>
              <td>
                <div>{{ item.chkOk }}</div>
              </td>
              <td>
                <div>{{ item.chkDate }}</div>
              </td>
            </tr>
          </template>
        </tbody>
      </table>
    </div>
    <div class="horizontal-direction horizontal-sign">
      <div class="text-left">总经理签核:</div>
      <div class="sign"></div>
    </div>
  </section>
</template>

<script>
module.exports = {
  props: {
    propsForm: {
      type: Object,
    },
  },
  data() {
    return {
      sessionStorageData: JSON.parse(sessionStorage.parameterData),
      applicationForm: {
        detailList: [],
      },
    };
  },
  mounted() {},
};
</script>

<style>
.page {
  margin: auto;
  width: 100%;
  max-width: 297mm;
}
.title {
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: bold;
}
.out-table {
  border-collapse: separate;
  box-sizing: border-box;
}
.out-table th {
  background-color: #b3ffb3;
}
</style>
